/*----------------------------------------*/
/*  Wizard Element Styles 
/*----------------------------------------*/

//
// Wizard
//

// Variables
$wizard-arrow-border-color: #ccc !default;
$wizard-default-color: $gray-500;
$wizard-done-color: $primary;
$accordion-card-title-font-size: 1.15rem;
$accordion-card-icon-font-size: 1.4rem;
$accordion-svg-toggle-width: 3rem;

.wizard {
    // Step info
    [data-wizard-type="step-info"] {
        display: none;

        &[data-wizard-state="current"] {
            display: block;
        }
    }

    // Content states
    [data-wizard-type="step-content"] {
        display: none;

        &[data-wizard-state="current"] {
            display: block;
        }
    }

    // Buttons states
    & {
        [data-wizard-type="action-prev"] {
            display: none;
        }

        [data-wizard-type="action-next"] {
            display: inline-block;
        }

        [data-wizard-type="action-submit"] {
            display: none;
        }
    }

    &[data-wizard-state="first"] {
        [data-wizard-type="action-prev"] {
            display: none;
        }

        [data-wizard-type="action-next"] {
            display: inline-block;
        }

        [data-wizard-type="action-submit"] {
            display: none;
        }
    }

    &[data-wizard-state="between"] {
        [data-wizard-type="action-prev"] {
            display: inline-block;
        }

        [data-wizard-type="action-next"] {
            display: inline-block;
        }

        [data-wizard-type="action-submit"] {
            display: none;
        }
    }

    &[data-wizard-state="last"] {
        [data-wizard-type="action-prev"] {
            display: inline-block;
        }

        [data-wizard-type="action-next"] {
            display: none;
        }

        [data-wizard-type="action-submit"] {
            display: inline-block;
        }
    }

    // Enable cursor pointer on clickable wizards
    &[data-wizard-clickable="true"] {
        .wizard-step {
            cursor: pointer;
        }
    }
}

// wizard steps
.wizard {
    .wizard-steps {
        display: flex;
        justify-content: center;
        align-items: flex-start;

        .wizard-step {
            position: relative;
            display: flex;
            align-items: center;
            flex-direction: column;
            flex: 1;
            text-align: center;
            color: $wizard-default-color;
            cursor: pointer;
            z-index: 0;

            .wizard-arrow {
                position: absolute;
                left: -10%;
                top: 1rem;
                width: 2rem;
                height: 2rem;
                display: none;
                font-size: 1.25rem;

                &:empty {
                    width: 20%;
                    height: 1px;
                    border-top: 1px dashed $wizard-arrow-border-color;
                    content: "";
                    top: 2rem;
                }
            }

            .wizard-label {
                display: flex;
                align-items: center;
                justify-content: center;
                flex-direction: column;

                .wizard-icon {
                    width: 4rem;
                    height: 4rem;
                    text-align: center;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    border-radius: 50%;
                    padding: 6%;
                    background: #f7f8fa;
                    font-size: 2rem;
                }

                .wizard-title {
                    font-size: 1.1rem;
                    font-weight: 500;
                    margin-top: 0.75rem;
                }
            }

            &:not(:first-child) .wizard-arrow {
                display: block;
            }

            &[data-wizard-state="done"],
            &[data-wizard-state="current"] {
                color: $wizard-done-color;
            }
        }
    }
}

.wizard.wizard-line {
    .wizard-steps {
        counter-reset: section;

        .wizard-step {
            &::after {
                position: absolute;
                left: 20%;
                top: -40%;
                font-size: 4rem;
                counter-increment: section;
                content: counter(section);
                color: rgba(255, 190, 0, 0.1);
                z-index: -1;
                font-style: italic;
                font-family: Impact;
            }

            .wizard-icon {
                position: relative;

                &::after {
                    content: "";
                    width: 84%;
                    height: 84%;
                    border: 1px dashed #fff;
                    border-radius: 50%;
                    display: block;
                    position: absolute;
                    left: 8%;
                    top: 8%;
                }

                i {
                    color: #fff;
                    font-size: 1.5rem;
                }
            }

            .wizard-label {
                .wizard-title {
                    color: #000;
                    font-size: 1rem;
                    margin-top: 1rem;
                }
            }
        }
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .wizard {
        .wizard-steps {
            .wizard-step {
                .wizard-label {
                    margin-left: 1.5rem;
                    margin-right: 1.5rem;

                    .wizard-icon {
                        font-size: 3.75rem;
                    }

                    .wizard-title {
                        margin-top: 0.75rem;
                    }
                }

                .wizard-arrow {
                    font-size: 1.1rem;
                }
            }
        }
    }
}

@media (max-width: 767.98px) {
    .wizard {
        .wizard-steps {
            flex-direction: column;

            .wizard-step {
                width: 100%;
                flex-direction: row;
                justify-content: space-between;
                margin-bottom: 0.5rem;
                margin-top: 0.5rem;

                .wizard-label {
                    flex-direction: row;
                    display: flex;
                    align-items: center;
                    margin-left: 0;
                    margin-right: 0;

                    .wizard-icon {
                        font-size: 1.5rem;
                        margin-right: 1.25rem;
                    }
                }

                .wizard-arrow {
                    font-size: 1rem;

                    &.last {
                        display: block;
                    }
                }
            }
        }
    }
}
